$.ajax({
    url: '/api/order_platform_data',
    type: 'get',
    success: function (resp) {
        res = resp.res

        var chartDom = document.querySelector('#pie')
        var myChart = echarts.init(chartDom);
        var option;

        option = {
            title: {
                text: '各渠道转化用户数量',
                subtext: '2019年',
                left: 'center'
            },
            tooltip: {
                trigger: 'item'
            },
            legend: {
                orient: 'vertical',
                left: 'left',
            },
            series: [
                {
                    name: '访问来源',
                    type: 'pie',
                    radius: '50%',
                    data: res,
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        option && myChart.setOption(option);
    }
})



